/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.yy.bugzillahelp.timer;

import java.awt.event.ActionEvent;

/**
 *
 * @author hualun-alan
 */
public class FixedTimerEvent implements TimerEvent {

    protected long preMillis;
    protected long interval;
    protected boolean on;

    public FixedTimerEvent() {
    }

    public long getInterval() {
        return interval;
    }

    public void setInterval(long interval) {
        this.interval = interval;
    }

    @Override
    public boolean throughCondition() {
        if (on) {
            long curMillis = System.currentTimeMillis();
            if (curMillis - preMillis >= interval) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }

    @Override
    public void actionPerformed(ActionEvent e) {
    }
}
